home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
oper_sys
/
oasis
/
ossxmpls.lha
/
examples
/
hanoi.pl
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1992-03-25
|
175 b
|
10 lines
/* Prolog version of hanoi benchmark */
main :- han(20,1,2,3).
han(N,_,_,_) :- N=<0.
han(N,A,B,C) :- N>0,
N1 is N - 1,
han(N1,A,C,B),
han(N1,C,B,A).